package com.example.educationalsystem.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.example.educationalsystem.common.util.LocalDateConverter;
import com.example.educationalsystem.common.util.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author zpc
 * @since 2022-12-02
 */
@ColumnWidth(30)//注释在具体属性上,设置单独列。注释在类上,统一设置列宽
@HeadRowHeight(30)//设置表头行高
@ContentRowHeight(20)//统一设置数据行行高
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("student")
@ApiModel(value="Student对象", description="")
public class Student extends Model<Student> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "学号:20201152xx")
    @ExcelProperty(value = "学号", index = 0)
    @TableId("student_id")
    private String studentId;

    @ApiModelProperty(value = "学生姓名: 张三")
    @ExcelProperty(value = "学生姓名", index = 1)
    @TableField("student_name")
    private String studentName;

    @ApiModelProperty(value = "学生性别：男")
    @ExcelProperty(value = "学生性别", index = 2)
    @TableField("student_sex")
    private String studentSex;

    @ApiModelProperty(value = "学生出生日期：199-12-03")
    @ExcelProperty(value = "学生出生日期", index = 3,converter = LocalDateConverter.class)
    @TableField("student_birthday")
    private LocalDate studentBirthday;


    @Override
    protected Serializable pkVal() {
        return this.studentId;
    }

}
